package com.iceengine.j3d.helper;

/**
 * Helper class for loading content.
 * Uses slick-util texture loader!
 * @author penguin
 */
import org.newdawn.slick.opengl.Texture;
import org.newdawn.slick.opengl.TextureLoader;
import java.io.FileInputStream;

public class Loader {
    /**
     * Load a texture that is located at the given path.
     * @param Decoder Decoder for the texture format (.png = "PNG".....).
     * @param Path Path where the texture is located at.
     * @return
     */
    public static Texture loadTexture(String Decoder, String Path)
    {
        Texture texture = null;
        try {
            texture = TextureLoader.getTexture(Decoder, new FileInputStream(Path));
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return texture;
    }
}
